using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._JoinsandRelates
{
    /// <summary>
    /// <para>Validate Join</para>
    /// <para>Validates a  join between two layers or tables to determine if the layers or tables have valid field names and Object ID fields, if the join produces matching records, is a one-to-one or one-to-many join, and other properties of the join.</para>
    /// <para>验证两个图层或表之间的连接，以确定图层或表是否具有有效的字段名称和对象 ID 字段，连接是否生成匹配记录、是一对一连接还是一对多连接，以及连接的其他属性。</para>
    /// </summary>    
    [DisplayName("Validate Join")]
    public class ValidateJoin : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ValidateJoin()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_layer_or_view">
        /// <para>Input Layer or Table View</para>
        /// <para>The layer or table view with the join to the join table that will be validated.</para>
        /// <para>图层或表视图，其中包含将要验证的连接表的连接。</para>
        /// </param>
        /// <param name="_in_field">
        /// <para>Input Join Field</para>
        /// <para>The field in the input layer or table view on which the join will be based.</para>
        /// <para>连接将基于的输入图层或表视图中的字段。</para>
        /// </param>
        /// <param name="_join_table">
        /// <para>Join Table</para>
        /// <para>The table or table view with the join to the input layer or table view that will be validated.</para>
        /// <para>具有与将要验证的输入图层或表视图的联接的表或表视图。</para>
        /// </param>
        /// <param name="_join_field">
        /// <para>Join Table Field</para>
        /// <para>The field in the join table that contains the values on which the join will be based.</para>
        /// <para>连接表中包含连接所基于的值的字段。</para>
        /// </param>
        public ValidateJoin(object _in_layer_or_view, object _in_field, object _join_table, object _join_field)
        {
            this._in_layer_or_view = _in_layer_or_view;
            this._in_field = _in_field;
            this._join_table = _join_table;
            this._join_field = _join_field;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Validate Join";

        public override string CallName => "management.ValidateJoin";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_layer_or_view, _in_field, _join_table, _join_field, _output_msg, _match_count, _row_count];

        /// <summary>
        /// <para>Input Layer or Table View</para>
        /// <para>The layer or table view with the join to the join table that will be validated.</para>
        /// <para>图层或表视图，其中包含将要验证的连接表的连接。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Layer or Table View")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_layer_or_view { get; set; }


        /// <summary>
        /// <para>Input Join Field</para>
        /// <para>The field in the input layer or table view on which the join will be based.</para>
        /// <para>连接将基于的输入图层或表视图中的字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Join Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_field { get; set; }


        /// <summary>
        /// <para>Join Table</para>
        /// <para>The table or table view with the join to the input layer or table view that will be validated.</para>
        /// <para>具有与将要验证的输入图层或表视图的联接的表或表视图。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Join Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _join_table { get; set; }


        /// <summary>
        /// <para>Join Table Field</para>
        /// <para>The field in the join table that contains the values on which the join will be based.</para>
        /// <para>连接表中包含连接所基于的值的字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Join Table Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _join_field { get; set; }


        /// <summary>
        /// <para>Output Table</para>
        /// <para>The output table containing the validation messages in a tabular form.</para>
        /// <para>以表格形式包含验证消息的输出表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Table")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _output_msg { get; set; } = null;


        /// <summary>
        /// <para>Match Count</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Match Count")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public long _match_count { get; set; }


        /// <summary>
        /// <para>Row Count</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Row Count")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public long _row_count { get; set; }


        public ValidateJoin SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}